import React from "react";
import LearnContext3 from "./learn-context3";
import MyContext from "./context";

export default class LearnContext4 extends React.Component {
  static contextType = MyContext;

  hello() {
    this.context.onChildHandle("哈喽 兄弟");
  }

  render() {
    return (
      <div>
        <div>二儿子</div>
        <button onClick={() => this.hello()}>给大儿子问声好</button>
      </div>
    );
  }
}
